﻿using System;
using System.Windows.Forms;
using BingDesktopChanger.Forms;
using System.Windows.Forms.VisualStyles;

namespace BingDesktopChanger
{
    class Program
    {
        static void Main(string[] args)
        {
            if (args.Length > 0)
                switch (args[0].ToLowerInvariant())
                {
                    case "automatic":
                        DBImageManager manager = new DBImageManager(new FileImageManager());
                        ImageReader ir = new ImageReader(manager);
                        if (ir.ReadDayImages(DateTime.Today))
                        {
                            var images = manager.GetImageList(DateTime.Today);
                            if (images.Length > 0)
                                WallPaperChanger.Set(new Uri(images[0]), WallPaperChanger.Style.Stretched);
                        }
                        return;
                    case "upgrade":
                        return;

                }
            if (VisualStyleInformation.IsSupportedByOS)
                Application.EnableVisualStyles();
            Application.Run(new frmViewer());
        }
    }
}
